<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.4.4/babel.min.js"></script> -->
    </head>
    <body>

    <div id="output"></div>
<!-- Load Babel -->

<!-- Your custom script here -->
<script>
<!-- import a from '/test2.js'
// console.log(a) -->
// east-lady-fe.thinkms.com

// let getDomain = (host) => {
//   host = host.split(':')[0]
//   return isNaN(host.substring(host.lastIndexOf('.'))) ? host.substring(host.substring(0, host.lastIndexOf('.')).lastIndexOf('.') + 1) : host
// }
// console.log(getDomain('east-lady-fe.thinkms.com/#/'))
// 1,2,3 a,b,c
function destructuringArray(array, destructor) {
  return destructor.reduce((prev, next, index) => {
    if (Array.isArray(next)) {
      return { ...prev, ...destructuringArray(array[index], next) }
    } else {
      prev[next] = array[index]
      return prev
    }
  }, {})
}


    console.log(destructuringArray([1,[2,3],4],['a',['b','c'],'d']))


</script>
    </body>
</html>